package com.member.common.enums;


import lombok.Getter;

import java.util.Objects;

/**
 * @author wangxin
 */
@Getter
public enum UserMemberStatusEnum {
    /**
     * 无效
     */
    INVALID(0, "无效"),

    /**
     * 有效
     */
    EFFECTIVE( 1, "有效"),
    ;

    private final Integer key;
    private final String desc;

    UserMemberStatusEnum(Integer key, String desc) {
        this.key = key;
        this.desc = desc;
    }

    public static UserMemberStatusEnum getByKey(Integer key){
        for (UserMemberStatusEnum item : UserMemberStatusEnum.values()){
            if(Objects.equals(item.getKey(), key)){
                return item;
            }
        }
        return null;
    }

}
